<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: lib/core/include/chi/GraphStruct.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">chigraph
   &#160;<span id="projectnumber">master</span>
   </div>
   <div id="projectbrief">Systems programming language written for beginners in LLVM</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('GraphStruct_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">GraphStruct.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="GraphStruct_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#ifndef CHI_STRUCT_TYPE_HPP</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#define CHI_STRUCT_TYPE_HPP</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="DataType_8hpp.html">chi/DataType.hpp</a>&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="core_2include_2chi_2Fwd_8hpp.html">chi/Fwd.hpp</a>&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechi.html">chi</a> {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html">   18</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structchi_1_1GraphStruct.html">GraphStruct</a> {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <a class="code" href="structchi_1_1GraphStruct.html#ab9d9a6c278322a563b1d57ec847abe63">GraphStruct</a>(<a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>&amp; mod, std::string <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">   26</a></span>&#160;    <a class="code" href="structchi_1_1Context.html">Context</a>&amp; <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *mContext; }</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">   30</a></span>&#160;    <a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>&amp; <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *mModule; }</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    std::vector&lt;NodeInstance*&gt; <a class="code" href="structchi_1_1GraphStruct.html#a464c5edd4ebcb07161c3d05312f1fc33">setName</a>(std::string newName, <span class="keywordtype">bool</span> updateReferences = <span class="keyword">true</span>);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">   43</a></span>&#160;    <span class="keyword">const</span> std::string&amp; <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mName; }</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">   47</a></span>&#160;    <span class="keyword">const</span> std::vector&lt;NamedDataType&gt;&amp; <a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mTypes; }</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#aba05cdce9627a23da0449801e068d85d">addType</a>(<a class="code" href="structchi_1_1DataType.html">DataType</a> ty, std::string name, <span class="keywordtype">size_t</span> addBefore, <span class="keywordtype">bool</span> updateReferences = <span class="keyword">true</span>);</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#a89d3ea5e72ed6e7d8380fb82fa5eb521">modifyType</a>(<span class="keywordtype">size_t</span> <span class="keywordtype">id</span>, <a class="code" href="structchi_1_1DataType.html">DataType</a> newTy, std::string newName, <span class="keywordtype">bool</span> updateReferences = <span class="keyword">true</span>);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#a759b0b44c984d7aaa6c2fb32e035264b">removeType</a>(<span class="keywordtype">size_t</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> updateReferences = <span class="keyword">true</span>);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="structchi_1_1DataType.html">DataType</a> <a class="code" href="structchi_1_1GraphStruct.html#a27c5062196f73eae3125c0baeb592d00">dataType</a>();</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">void</span> updateNodeReferences();</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>* mModule;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <a class="code" href="structchi_1_1Context.html">Context</a>*     mContext;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    std::vector&lt;NamedDataType&gt; mTypes;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    std::string mName;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="structchi_1_1DataType.html">DataType</a> mDataType;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;};</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;}  <span class="comment">// namespace chi</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#endif  // CHI_STRUCT_TYPE_HPP</span></div><div class="ttc" id="structchi_1_1GraphStruct_html_a464c5edd4ebcb07161c3d05312f1fc33"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a464c5edd4ebcb07161c3d05312f1fc33">chi::GraphStruct::setName</a></div><div class="ttdeci">std::vector&lt; NodeInstance * &gt; setName(std::string newName, bool updateReferences=true)</div><div class="ttdoc">Set the name of the struct, and optionally update all references in the context. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00024">GraphStruct.cpp:24</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ad25ddcbdf75436b9a0f76720d34257d4"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">chi::GraphStruct::name</a></div><div class="ttdeci">const std::string &amp; name() const</div><div class="ttdoc">Get the name of the type. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00043">GraphStruct.hpp:43</a></div></div>
<div class="ttc" id="core_2include_2chi_2Fwd_8hpp_html"><div class="ttname"><a href="core_2include_2chi_2Fwd_8hpp.html">Fwd.hpp</a></div><div class="ttdoc">Forward declares all the chigraph data types. </div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html"><div class="ttname"><a href="structchi_1_1GraphStruct.html">chi::GraphStruct</a></div><div class="ttdoc">A class holding a compound type defined in a GraphModule. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00018">GraphStruct.hpp:18</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a89d3ea5e72ed6e7d8380fb82fa5eb521"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a89d3ea5e72ed6e7d8380fb82fa5eb521">chi::GraphStruct::modifyType</a></div><div class="ttdeci">void modifyType(size_t id, DataType newTy, std::string newName, bool updateReferences=true)</div><div class="ttdoc">Change the type and name of a type. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00082">GraphStruct.cpp:82</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a82a1da52a4bf23e1e7fef4d7228603b1"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">chi::GraphStruct::module</a></div><div class="ttdeci">GraphModule &amp; module() const</div><div class="ttdoc">Get the module. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00030">GraphStruct.hpp:30</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ab9d9a6c278322a563b1d57ec847abe63"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ab9d9a6c278322a563b1d57ec847abe63">chi::GraphStruct::GraphStruct</a></div><div class="ttdeci">GraphStruct(GraphModule &amp;mod, std::string name)</div><div class="ttdoc">GraphType constructor; don&amp;#39;t use this use GraphModule::newStruct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00021">GraphStruct.cpp:21</a></div></div>
<div class="ttc" id="structchi_1_1Context_html"><div class="ttname"><a href="structchi_1_1Context.html">chi::Context</a></div><div class="ttdoc">The class that handles the loading, creation, storing, and compilation of modules It also stores a LL...</div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00055">Context.hpp:55</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a262915d6d2148d7234525e9ccfa5c9d5"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">chi::GraphStruct::context</a></div><div class="ttdeci">Context &amp; context() const</div><div class="ttdoc">Get the context. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00026">GraphStruct.hpp:26</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a27c5062196f73eae3125c0baeb592d00"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a27c5062196f73eae3125c0baeb592d00">chi::GraphStruct::dataType</a></div><div class="ttdeci">DataType dataType()</div><div class="ttdoc">Get the DataType of the struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00111">GraphStruct.cpp:111</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a759b0b44c984d7aaa6c2fb32e035264b"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a759b0b44c984d7aaa6c2fb32e035264b">chi::GraphStruct::removeType</a></div><div class="ttdeci">void removeType(size_t id, bool updateReferences=true)</div><div class="ttdoc">Remove a type from a struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00097">GraphStruct.cpp:97</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ae1895cfaebac03e21d35ec2a155b3c10"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">chi::GraphStruct::types</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; types() const</div><div class="ttdoc">Get the types the struct contains. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00047">GraphStruct.hpp:47</a></div></div>
<div class="ttc" id="DataType_8hpp_html"><div class="ttname"><a href="DataType_8hpp.html">DataType.hpp</a></div><div class="ttdoc">Defines the DataType class. </div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_aba05cdce9627a23da0449801e068d85d"><div class="ttname"><a href="structchi_1_1GraphStruct.html#aba05cdce9627a23da0449801e068d85d">chi::GraphStruct::addType</a></div><div class="ttdeci">void addType(DataType ty, std::string name, size_t addBefore, bool updateReferences=true)</div><div class="ttdoc">Add a new type to the struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00068">GraphStruct.cpp:68</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html"><div class="ttname"><a href="structchi_1_1GraphModule.html">chi::GraphModule</a></div><div class="ttdoc">Module that holds graph functions. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00016">GraphModule.hpp:16</a></div></div>
<div class="ttc" id="namespacechi_html"><div class="ttname"><a href="namespacechi.html">chi</a></div><div class="ttdoc">The namespace where chigraph lives. </div><div class="ttdef"><b>Definition:</b> <a href="BitcodeParser_8hpp_source.html#l00012">BitcodeParser.hpp:12</a></div></div>
<div class="ttc" id="structchi_1_1DataType_html"><div class="ttname"><a href="structchi_1_1DataType.html">chi::DataType</a></div><div class="ttdoc">A type of data Loose wrapper around llvm::Type*, except it knows which ChiModule it&amp;#39;s in and it embed...</div><div class="ttdef"><b>Definition:</b> <a href="DataType_8hpp_source.html#l00017">DataType.hpp:17</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_a2d5e495f4b604d04f57d90095a59dd6.html">core</a></li><li class="navelem"><a class="el" href="dir_a979adfa99d5a8626731f83d5067598b.html">include</a></li><li class="navelem"><a class="el" href="dir_afbc2aa4d9616322ddf4041ba4f8ade6.html">chi</a></li><li class="navelem"><a class="el" href="GraphStruct_8hpp.html">GraphStruct.hpp</a></li>
    <li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
